export const isFunction = (fn: unknown): boolean => {
  return typeof fn === 'function'
}
// 如果x存在，并且x.length类型为number 并且不等于函数那么就是数组
export const isArrayLike = (x: any) => x && typeof x?.length === 'number' && typeof x !== 'function'

// 接收一个对象,如果有挂载then函数那就断言为Promise
export const isPromise = (x: any) => isFunction(x?.then)